#ifndef __GAME_H__
#define __GAME_H__

// 数字字模，4x8
unsigned char NUM_CHARS[] = {
    0x7F, 0x41, 0x41, 0x7F, // 0字模
    0x00, 0x00, 0x00, 0x7F, // 1字模
    0x79, 0x49, 0x49, 0x4F, // 2字模
    0x49, 0x49, 0x49, 0x7F, // 3字模
    0x0F, 0x08, 0x08, 0x7F, // 4字模
    0x4F, 0x49, 0x49, 0x79, // 5字模
    0x7F, 0x49, 0x49, 0x79, // 6字模
    0x01, 0x01, 0x01, 0x7F, // 7字模
    0x7F, 0x49, 0x49, 0x7F, // 8字模
    0x4F, 0x49, 0x49, 0x7F, // 9字模
};

/**
 * 左右箭头，4x8
 */
unsigned char LEFT_ARROW[] = {0x08, 0x1c, 0x3e, 0x7f};
unsigned char RIGHT_ARROW[] = {0x7f, 0x3e, 0x1c, 0x08};

/**
 * SPEED 字模，4x8
 */
unsigned char SPEED_CHARS[] = {
    0x46, 0x49, 0x49, 0x31,  // S
    0x00,                    // 空一列
    0x7F, 0x09, 0x09, 0x06,  // P
    0x00,                    // 空一列
    0x7F, 0x49, 0x49, 0x49,  // E
    0x00,                    // 空一列
    0x7F, 0x49, 0x49, 0x49,  // E
    0x00,                    // 空一列
    0x7F, 0x41, 0x41, 0x3E}; // D

// SCORE字模 4*8
char code SCORE_CHARS[] = {0x46, 0x49, 0x49, 0x31, 0x00, 0x3E, 0x41, 0x41, 0x22, 0x00, 0x3E, 0x41,
                           0x41, 0x3E, 0x00, 0x7F, 0x11, 0x29, 0x46, 0x00, 0x7F, 0x49, 0x49, 0x49};

unsigned char xdata RIGHT_WORDS_CN[] = {
    0x00, 0xFE, 0x02, 0x22, 0x42, 0x82, 0x72, 0x02, 0x22, 0x42, 0x82, 0x72, 0x02, 0xFE, 0x00, 0x00,
    0x00, 0xFF, 0x10, 0x08, 0x06, 0x01, 0x0E, 0x10, 0x08, 0x06, 0x01, 0x4E, 0x80, 0x7F, 0x00, 0x00, /*"网",0*/
    0x20, 0x20, 0xFF, 0x20, 0x24, 0xF4, 0x54, 0x54, 0x54, 0xFF, 0x54, 0x55, 0x56, 0xF4, 0x04, 0x00,
    0x00, 0x00, 0xFF, 0x00, 0x08, 0x0B, 0x19, 0x69, 0x09, 0x0B, 0x49, 0x89, 0x7D, 0x0B, 0x08, 0x00}; /*"博",1*/

unsigned char xdata RIGHT_WORDS_EN[] = {
    0x00, 0x00, 0x02, 0xFE, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x00, 0x00, /*"I",0*/
    0x02, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, /*"T",1*/
    0xF8, 0x04, 0xE2, 0x12, 0xF2, 0x04, 0xF8, 0x00, 0x0F, 0x10, 0x23, 0x24, 0x27, 0x24, 0x13, 0x00, /*"@",2*/
    0x00, 0x80, 0x78, 0x06, 0x78, 0x80, 0x00, 0x00, 0x38, 0x07, 0x04, 0x04, 0x04, 0x07, 0x38, 0x00, /*"A",3*/
    0xFE, 0x18, 0x60, 0x80, 0x00, 0x00, 0xFE, 0x00, 0x3F, 0x00, 0x00, 0x01, 0x06, 0x18, 0x3F, 0x00, /*"N",4*/
    0x06, 0x18, 0x60, 0x80, 0x60, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00  /*"Y",5*/
};

unsigned char xdata PAUSE_CHARS[] = {
    0x60, 0xE0, 0xE0, 0x60, 0x60, 0x60, 0xE0, 0xC0, 0xC0, 0xFF, 0xFF, 0xD8, 0x18, 0x18, 0x1F, 0x0F, /*"p",0*/
    0x00, 0xC0, 0xE0, 0x60, 0x60, 0xE0, 0xC0, 0x00, 0x00, 0x0E, 0x1E, 0x1B, 0x19, 0x1F, 0x1F, 0x18, /*"a",1*/
    0x60, 0xE0, 0xE0, 0x00, 0x00, 0x60, 0xE0, 0xE0, 0x00, 0x0F, 0x1F, 0x18, 0x18, 0x18, 0x1F, 0x1F, /*"u",2*/
    0x00, 0xC0, 0xE0, 0x60, 0x60, 0xE0, 0xE0, 0x00, 0x00, 0x1C, 0x1D, 0x19, 0x1B, 0x1E, 0x0E, 0x00, /*"s",3*/
    0x00, 0xC0, 0xE0, 0x60, 0x60, 0xE0, 0xC0, 0x00, 0x00, 0x0F, 0x1F, 0x19, 0x19, 0x1D, 0x0D, 0x00  /*"e",4*/
};

/**
 * 使用一个2byte数据描述一个方块形状，对应一个4x4，一共16个格子区域
 * 换算到显示的像素，每个格子对应4x4像素
 */
unsigned int code TETRIS_SHAPES[7][4] = {
    // I
    {0xF000, 0x4444, 0xF000, 0x4444},
    // L
    {0xE800, 0xc440, 0x2e00, 0x88c0},
    // J
    {0xE200, 0x44c0, 0x8e00, 0xc880},
    // O
    {0xcc00, 0xcc00, 0xcc00, 0xcc00},
    // Z
    {0xc600, 0x4c80, 0xc600, 0x4c80},
    // S
    {0x6c00, 0x8c40, 0x6c00, 0x8c40},
    // T
    {0x4e00, 0x8c80, 0xe400, 0x4c40}};

#endif